package com.paas.demo.config;

import org.springframework.boot.web.servlet.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author : pengjie
 * @PackageName : com.zero.insp.config
 * @Description : TODO
 * @email : 627799251@qq.com
 * @Date : 2019/4/2 14:00
 */
@Configuration
public class FilterConfig {
    @Bean
    public FilterRegistrationBean registFilter() {
        FilterRegistrationBean registration = new FilterRegistrationBean();
        registration.setFilter(new CustomCorsFilter());
        registration.addUrlPatterns("/*");
        registration.setName("CustomCorsFilter");
        registration.setOrder(1);
        return registration;
    }
}
